package com.example.serverSide.commom.util;

/**
 * 基于ThreadLocal创建的工具类，用于保存当前的用户id
 */
public class BaseContext {
    private static Long userId;
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id){
        userId = id;
        //threadLocal.set(id);//设置数据
    }
    public static Long getCurrentId(){
        return userId;
        //return threadLocal.get();
    }
}
